package com.xisoft.base.config.mybatis;

import org.apache.ibatis.reflection.MetaObject;
import org.apache.ibatis.reflection.wrapper.ObjectWrapper;
import org.apache.ibatis.reflection.wrapper.ObjectWrapperFactory;

import java.util.Map;

/**
 * *
 * Created with Description:
 *
 * @version 1.0 <br>
 * @packagename: com.xisoft.base.config.mybatis<br>
 * @author: LiBencheng <br>
 * @computer: licheng <br>
 * @date: Created on 2022/8/12 18:14 <br>
 */
public class BeanWrapperFactory implements ObjectWrapperFactory
{

    @Override public boolean hasWrapperFor(Object o)
    { return o != null && o instanceof Map; }

    @Override public ObjectWrapper getWrapperFor(MetaObject metaObject, Object o)
    { return new MyBeanWrapper(metaObject, (Map) o); }

}
